package com.lz.ccjdemo.act;

import android.arch.lifecycle.Observer;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.TextView;

import com.lz.ccjdemo.R;
import com.lz.ccjdemo.base.BaseActivity;
import com.lz.ccjdemo.http.model.BaseModel;
import com.lz.ccjdemo.utils.DataChangeUtils;

public class DataChangeActivity extends BaseActivity<BaseModel> {
    private TextView tvMsg;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_data_change);
        tvMsg=findViewById(R.id.tv_msg);
        DataChangeUtils.getInstance().getStrData().observe(this, new Observer<String>() {
            @Override
            public void onChanged(@Nullable String str) {
                tvMsg.setText(str);
            }
        });
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        DataChangeUtils.getInstance().closeRun();
    }
}
